<template>
<div class="product-add">
    <!--form表单-->
    <el-form size="small" ref="form" :model="form" label-width="200px">
      <!--清理缓存-->
      <div class="common-form">{{$t('setting.clear_cache')}}</div>
      <el-form-item :label="$t('setting.data_cache_label')">
        <span>{{$t('setting.clear_all_cache')}}</span>
      </el-form-item>
      <!--提交-->
      <div class="common-button-wrapper">
        <el-button type="primary" @click="onSubmit">{{$t('setting.submit_button')}}</el-button>
      </div>
    </el-form>
  </div>
</template>

<script>
import SettingApi from "@/api/setting.js";
export default {
  data() {
    return {
      form: {
        keys: []
      },
      list: []
    };
  },
  created() {},
  methods: {
    //提交表单
    onSubmit() {
      let self = this;
      let params = this.form;
      SettingApi.clearCache(params, true).then(data => {
        ElMessage({
          message: $t("setting.clear_success_message"),
          type: "success"
        });
        self.$router.push("/setting/clear/index");
      }).catch(error => {});
    },
    //监听复选框选中
    handleCheckedCitiesChange(val) {}
  }
};
</script>

<style>
.tips {
  color: #ccc;
}
</style>

